package ioc15;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/5/17 13:34
 * Version:1.0-SNAPSHOT
 * Description:
 */
public class Test {

    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("ioc15/spring.xml");
//        System.out.println(ac.getBean("someBean"));
//        System.out.println(ac.getBean("otherBean"));
//        System.out.println(ac.getBean("otherBean2"));
        SomeBean someBean = (SomeBean) ac.getBean("someBean");
        OtherBean otherBean = (OtherBean) ac.getBean("otherBean");
        OtherBean otherBean2 = (OtherBean) ac.getBean("otherBean2");
        System.out.println("someBean:"+someBean.getName());
        System.out.println("otherBean:"+otherBean.getName());
        System.out.println("otherBean2:"+otherBean2.getName());
    }

}
